<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>AUI快速完成布局</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <style>
        html,
        body {
            height: 100%;
            background-color: transparent;
        }

        #box::-webkit-scrollbar {
            display: none;
        }

        #box ul li {
            padding: 10px 10px;
            border-bottom: 1px solid #ccc;
        }
        #box ul li img {
            display: block;
            margin: 0 auto;
            height: 20px;
        }
    </style>
</head>

<body>
    <div id="header-select" style="height:260px;width:100%">
        &nbsp;
    </div>
    <div id="footer-select">
        <h2 style="height:50px;line-height:50px;background-color:#fff;text-align:center;margin:0px 20px;border-radius:10px;">选择淘宝等级</h2>
        <div id="box" style="border-radius:10px;height:350px;background-color:#fff;overflow:scroll;margin:10px 20px;">
            <ul>
            </ul>
        </div>
        <h2 style="height:40px;line-height:50px;background-color:#fff;text-align:center;margin:0px 20px;height:50px;border-radius:10px;">取消</h2>

    </div>

</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="./conf/config.js"></script>
<script type="text/javascript" src="./js/common.js"></script>
<script type="text/javascript">
    apiready = function() {
        fnAddSelectImg();
    };

    function fnAddSelectImg() {

        for (var i = 1; i < 16; i++) {
            var html = '<li onclick="passSelectImgVal(this)"><img  src="http://www.renqishike.com/static/images/taobao/' + i + '.gif" data-val="' + i + '" ></li>';
            $("#box").find('ul').append(html);
        }

    }

    function passSelectImgVal(that) {

       var selectCteditRatImg ={
         "imgId":$(that).find("img").attr("data-val"),
          "imgUrl":$(that).find("img").attr("src"),
       } ;
      $api.setStorage('selectCteditRatImg', selectCteditRatImg);
      api.sendEvent({
          name: 'selectCteditRat',
          extra: {
              selectCteditRatImg: selectCteditRatImg
          }
      });
      api.closeFrame();
        // var selectCteditRatImg = $(that).attr("src");
        // $("#selectCteditRatImg").val(selectCteditRatImg);
        // //$(parent.frames["topFrame"].document).find("#leftUserId").val()
        //
        //
        // //parent.获取参数的Frame.location = "网页?参数";
        // $api.setStorage('selectCteditRatImg', selectCteditRatImg);
        // // api.openFrame({
        // //     name: 'taobao_bind_frame',
        // //     url: './taobao_bind_frame.html',
        // //     pageParam: {
        // //          name:selectCteditRatImg;
        // //      }
        // //     bounces: true
        // // });
        // api.closeFrame();
    }
</script>

</html>
